#!/bin/bash

# 生成密钥
mkdir -p /tmp/neutron-panel
cd /tmp/neutron-panel

if [ ! -e ~/.ssh ]; then
    mkdir ~/.ssh
fi

ssh-keygen -t rsa -b 4096 -C "neturn-panel" -N '' -q -f "neutron-panel"
cp neutron-panel ~/.ssh/neutron-panel
cat neutron-panel.pub >> ~/.ssh/authorized_keys
rm /tmp/neutron-panel -r

# 写入profile用于获取tty调整缩放
echo -e 'export TERM=xterm-256color\necho -e "Now term[\\x04$(tty)\\x04]"' | sudo tee /etc/profile.d/neutron.sh > /dev/null
